package cn.exrick.xboot.modules.content.serviceimpl;

import cn.exrick.xboot.common.vo.SearchVo;
import cn.exrick.xboot.modules.base.dao.RolePermissionDao;
import cn.exrick.xboot.modules.base.entity.RolePermission;
import cn.exrick.xboot.modules.content.dao.HontRolePermissionDao;
import cn.exrick.xboot.modules.content.entity.HontRolePermission;
import cn.exrick.xboot.modules.content.service.HontRolePermissionService;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.criteria.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 角色权限接口实现
 * @author Exrick
 */
@Slf4j
@Service
@Transactional
public class HontRolePermissionServiceImpl implements HontRolePermissionService {

    @Autowired
    private HontRolePermissionDao rolePermissionDao;

    @Override
    public HontRolePermissionDao getRepository() {
        return rolePermissionDao;
    }

    @Override
    public List<HontRolePermission> findByHontPermissionId(String permissionId) {

        return rolePermissionDao.findByHontPermissionId(permissionId);
    }

    @Override
    public List<HontRolePermission> findByHontRoleId(String roleId) {

        return rolePermissionDao.findByHontRoleId(roleId);
    }

    @Override
    public void deleteByHontRoleId(String roleId) {

        rolePermissionDao.deleteByHontRoleId(roleId);
    }

}